package com.community.property.controller;

import com.community.common.core.controller.BaseController;
import com.community.property.domain.VO.PropertyBuildingVo;
import com.community.property.domain.VO.PropertyCommunityVO;
import com.community.property.domain.VO.PropertyHouseVO;
import com.community.property.service.IPropertyHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/house")
public class RepairHouseController extends BaseController {

    @Autowired
    private IPropertyHouseService houseService;

    @GetMapping("/getCommunityId")
    public List<PropertyCommunityVO> getCommunity( ) {
        return houseService.getCommunity();

    }

    @GetMapping("/getBuilding")
    public List<PropertyBuildingVo> getBuilding(Integer communityId) {
        return houseService.getBuildingId(communityId);
    }

    @GetMapping("/getHouse")
    public List<PropertyHouseVO> getHouse(Integer buildingId) {
        return houseService.getHouseId(buildingId);
    }

}
